import { constances } from "./index";

const defaultState = {
  list: [1,2,3],
  login: false,
  inputValue: '',
  showMsg: false
};


export default function (state = defaultState, action) {
  switch (action.type) {
    case constances.CHANGE_INPUT_VALUE :
      const newState = JSON.parse(JSON.stringify(state));
      newState.inputValue = action.value;
      return newState;
    case constances.CHANGE_LOGIN:
      const newState1 = JSON.parse(JSON.stringify(state));
      newState1.login = action.value;
      return newState1;
    default:
      return state;
  }
};